# Contributor: Leon Marz <main@lmarz.org>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=openxr
pkgver=1.1.42
pkgrel=0
pkgdesc="OpenXR loader library"
url="https://khronos.org/openxr"
arch="all"
license="Apache-2.0"
makedepends="cmake
	jsoncpp-dev
	jsoncpp-static
	mesa-dev
	samurai
	vulkan-loader-dev
	wayland-dev
	"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/KhronosGroup/OpenXR-SDK/archive/release-$pkgver.tar.gz"
builddir="$srcdir/OpenXR-SDK-release-$pkgver"
options="!check" # no check available

build() {
	case "$CARCH" in
		armhf)
			export CXXFLAGS="$CXXFLAGS -D_M_ARM" ;;
	esac

	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=Release
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
d142adb922900f984f802251c9286e62a245b29fe60c0de1acbc4d8ce979026387a2027d5287d5e639fdcb722d840d25794197e6eec0fb817d0d8aca4acbb7a0  openxr-1.1.42.tar.gz
"
